<template>
	<view class="">
		<u-gap height="30" bgColor="#fff"></u-gap>
		<view class="region-box">
			<view class="u-nav-slot">
				<u-icon :name="obj.leftIcon" size="19" @click="returnClick('left')"></u-icon>
			</view>
			<view class="u-nav-slot">
				<text>{{obj.title}}</text>
			</view>
			<view class="right-txt" @click="returnClick('right')">
				<text>{{obj.right}}</text>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		name: "navigation",
		props: {
			obj: {
				type: Object,
				default: () => {},
				required: true,
			},
		},
		data() {
			return {

			};
		},
		onLoad() {},
		methods: {
			// 跳转到首页
			returnClick(e) {
				if (e == 'left') {
					uni.switchTab({
						url: '/pages/index/index'
					})
				} else {
					this.$emit('returnClick')
				}

			}
		}
	}
</script>

<style scoped>
	.right-txt {
		margin: 0 5rpx 0 0rpx;
	}

	.region-box {
		padding: 60rpx 0 0 0;
		width: 100%;
		height: 220rpx;
		line-height: 170rpx;
		display: flex;
		justify-content: space-between;
		background-color: white;
	}
</style>